{% extends "base.html" %}

{% block title %}
	Developers Blog
{% endblock %}

{% block extrahead %}
<style>
	#Body {
		padding: 10px 10px 10px 0px;
	}
	
	p {
		line-height:1.5em;
		font-family:Verdana,sans-serif;
		font-size: 13px;
	}
	
	h1 {
		color:#333333;
		font-family:Verdana,sans-serif;
		font-size:1.4em;
		line-height:36px;
		margin-bottom:0px;
	}
	
	a.grey {
		color:#767676;
	}

	.grey {
		color:#767676;
	}
	
	#ListContent a:link {
		color:blue;
	}
	
	#ListContent .text {
		padding:10px 10px 10px 0px;
	}
	
	.footer {
		border-top:1px solid #CCCCCC;
		color:blue;
		font-size:10px;
		padding:2px 8px;
		text-align:right;
	}
</style>
{% endblock %}

{% block content %}
	{% if user.is_staff %}
	<a href="/blog/add_article/">
		<h1>
    	<img src="/appmedia/add.gif" style="vertical-align:middle">
    	New Post
    	</h1>
    </a>
    {% endif %}
    
    <div id="ListContent">
		{% for item in items %}
			<a href="/blog/{{item.id}}/">	
				<h1>{{item.title}}</h1>
			</a>
			
			<span class="grey">
				{{item.date_added|date:"j F Y"}}
				&nbsp;
				{% if user.is_staff %}
					<a class="grey" href="/blog/{{item.id}}/delete/">
						<img src="/appmedia/delete.gif" />
						Delete 
					</a>
					&nbsp;
					<a class="grey" href="/blog/{{item.id}}/edit/">
						<img src="/appmedia/edit.gif" />
						Edit 
					</a>
				{% endif %}
			</span>
			
			<div class="text">
				{{item.text}}
			</div>
			
			<div class="footer">
				<a href="/blog/{{item.id}}/#comments">
					Comments ({{item.get_comments_count}})
				</a>
			</div>
			<br />
		{% endfor %}
	</div>

	{% if items %}
		Pages: 
		{% for page in pages %}
			{% ifequal page current_page %}
				<b>{{page}}</b>
			{% else %}
			<a href="/blog/?page={{page}}"><b>{{page}}</b></a>
			{% endifequal %}
			&nbsp;&nbsp;
		{% endfor %}
		<br />
		<br />
	{% endif %}
{% endblock %}